package com.ec.pf.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ec.pf.pojo.BindingInfo;
import com.ec.pf.pojo.FamilyElderlyBinding;

import java.util.List;

public interface FamilyElderlyBindingService extends IService<FamilyElderlyBinding> {

    // 家属申请绑定老人
    FamilyElderlyBinding bindFamilyToElderly(Long familyUserId, Long elderlyUserId);

    // 老人申请绑定家属
    FamilyElderlyBinding bindElderlyToFamily(Long familyUserId, Long elderlyUserId);

    // 批准绑定申请
    boolean approveBinding(Long bindingId, Long adminId);

    // 拒绝绑定申请
    boolean rejectBinding(Long bindingId);

    // 管理员模糊查询绑定关系
    Page<BindingInfo> getBindingByFamilyAndElderlyNames(String familyName, String elderlyName, int page, int size);

    // 分页查询绑定申请记录
    Page<BindingInfo> getBindingDetails(int page, int size);

    // 分页查询家属自己发起的绑定记录
    Page<BindingInfo> getSelfBindingDetails(Long familyUserId, int page, int size);

    // 分页查询老人自己发起的绑定记录
    Page<BindingInfo> getElderlyBindingDetails(Long elderlyUserId, int page, int size);

    // 删除家属或老人自己的绑定申请记录
    boolean deleteSelfBinding(Long bindingId, Long userId);

    // 管理员删除绑定申请记录
    boolean deleteBindingByAdmin(Long bindingId);

    // 管理员批量删除绑定申请记录
    boolean batchDeleteBindingByAdmin(List<Long> bindingIds);
}
